package string;

import java.util.Arrays;

public class QOne {
    public static void main(String[] args) {
        String s = "We are happy.";
        System.out.println(replaceSpace(s));
    }

    public static String replaceSpace(String s) {
        /*char[] result = new char[(s.length())*3];
        int j = 0;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c!=32){
                result[j++] =  c;

            }else{
                result[j++] = '%';
                result[j++] = '2';
                result[j++] = '0';
            }
        }


        return String.valueOf(result);*/
        return s.replace(" ", "%20");

    }
}
